package com.aegis.manage.mapper;

import com.aegis.common.mybatis.mapper.WxBaseMapper;
import com.aegis.manage.api.dto.RolePermissionDTO;
import com.aegis.manage.api.vo.ApiInfoVO;
import com.aegis.manage.api.vo.ApiPermissionVO;
import com.aegis.manage.api.vo.PermissionGroupVO;
import com.aegis.manage.model.dos.SysPermission;
import com.baomidou.mybatisplus.core.metadata.IPage;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * (SysPermission)表数据库访问层
 *
 * @author makejava
 * @since 2024-02-12 20:03:29
 */
public interface SysPermissionMapper extends WxBaseMapper<SysPermission> {


    /**
     * 查询用户权限
     *
     * @param userId
     * @return
     */
    List<SysPermission> selectPermissionByUserId(@Param("userId") String userId);


    /**
     * 查询角色权限
     *
     * @param roleId
     * @return
     */
    List<RolePermissionDTO> selectRolePermissionByRoleId(@Param("roleId") String roleId);


    /**
     * @param page
     * @param keywords
     * @return
     */
    IPage<ApiInfoVO> queryApiInfoPage(IPage<ApiInfoVO> page,
                                      @Param("excludeGroupId") String excludeGroupId,
                                      @Param("keywords") String keywords);


    /**
     *
     * @param page
     * @param excludeAppId
     * @param keywords
     * @return
     */
    IPage<PermissionGroupVO> queryPermissionGroupPage(IPage<PermissionGroupVO> page,
                                                      @Param("excludeAppId") String excludeAppId,
                                                      @Param("keywords") String keywords);


    /**
     * 查询权限组的接口
     *
     * @param page
     * @param keywords
     * @return
     */
    IPage<ApiPermissionVO> queryGroupApiPermissionPage(IPage<ApiPermissionVO> page, @Param("groupId") String groupId, @Param("keywords") String keywords);
}

